<template>
  <div class="st">
    <van-list
      v-model="loading"
      :finished="finished"
      finished-text="没有更多了"
      @load="onLoad"
    >
    <van-cell v-for="item in list" :key="item.id" :title="item.title" />
</van-list>
  </div>
</template>

<script>
import axios from 'axios'
export default {
    created(){

    },
    data(){
        return{
          list: [],
          loading: false,
          finished: false,
          queryInfo:{
            page:0,
            limit:2
          },
        }
    },
    methods:{
      async onLoad() {
        this.queryInfo.page++;
        const res=await axios.get(
          "http://122.112.253.28:8080/EasyBuy/NewsListServlet",
          {
            params:this.queryInfo,
          });
          console.log(res.data);
          this.list.push(...res.data.data);
          this.loading=false;//停止加载
          if(res.data.data.length==0){
            this.finished=true;
          }
      },
    }
}
</script>

<style>
.st{
    margin-bottom: 70px;
}
</style>
